/**
 * 生成订单号
 * 格式：appid(2位) + YYYYMMDDHHmm + 3位随机数
 * @param appid 交易来源
 */
export function generateOrderId(appid: string): string {
  const now = new Date();
  const year = now.getFullYear();
  const month = String(now.getMonth() + 1).padStart(2, '0');
  const day = String(now.getDate()).padStart(2, '0');
  const hours = String(now.getHours()).padStart(2, '0');
  const minutes = String(now.getMinutes()).padStart(2, '0');
  const random = Math.floor(Math.random() * 900 + 100); // 生成100-999的随机数
  
  return `${appid}${year}${month}${day}${hours}${minutes}${random}`;
}

/**
 * 默认商户信息
 */
export const DEFAULT_MERCHANT = {
  merno: '999999999999997',  // 测试商户号
  terminal: '99999996'       // 测试终端号
}; 